<?php $structure = $section->getStructure(); ?>

<?php for ($i = 0; $i < strlen($structure); $i++): ?>
    <?php if(strcasecmp(substr($structure, $i, 1),'c') == 0): ?>
        <?php if($news->Valid()): ?>
            <?php $content = $news->current(); ?>
            <?php include_partial('renderSectionNewsContentExternalFeed',
                    array(
                        'content'      => $content,
                        'section'      => $section,
                        'portal'       => $portal,
                        'hasBigScreen' => $hasBigScreen
                    ))?>
            <?php $news->next(); ?>
            <?php if($i != strlen($structure)-1): ?>
                <hr class="separator">
            <?php endif; ?>
        <?php endif;?>
    <?php elseif(strcasecmp(substr($structure, $i, 1),'e') == 0): ?>
        <?php include_partial('render'.$elements[$i+1]->getType()->getType(),
                array(
                    strtolower($elements[$i+1]->getType()->getType()) => $elements[$i+1],
                    'portal' => $portal,
                    'hasBigScreen' => $hasBigScreen
                ))?>
        <?php if($i != strlen($structure)-1 && $contents->count()): ?>
            <hr class="separator">
        <?php endif; ?>
    <?php endif; ?>
<?php endfor;?>
<?php if ($have_to_paginate): ?>
    <div class="pagination-desc">
        <strong><?php echo count($news) ?></strong> Noticias - página <strong><?php echo $page ?>/<?php echo $total_pages ?></strong>
    </div>
    <div class="pagination">
        <a href="<?php echo url_for('render_section',$section) ?>?page=1">
            <img src="/uploads/default/first.png" alt="1ra página" title="1ra página" />
        </a>
        <?php if($has_prev): ?>
            <a href="<?php echo url_for('render_section', $section) ?>?page=<?php echo $page - 1 ?>">
                <img src="/uploads/default/previous.png" alt="Página anterior" title="Página anterior" />
            </a>
        <?php endif; ?>
        <strong>Página <?php echo $page ?></strong>
        <?php if($has_next): ?>
            <a href="<?php echo url_for('render_section', $section) ?>?page=<?php echo $page + 1 ?>">
                <img src="/uploads/default/next.png" alt="Página siguiente" title="Página siguiente" />
            </a>
        <?php endif; ?>
        <a href="<?php echo url_for('render_section', $section) ?>?page=<?php echo $total_pages ?>">
            <img src="/uploads/default/last.png" alt="Ultima página" title="Last page" />
        </a>
    </div>
<?php endif; ?>